package cn.example.gate.protocolBuf;

import io.netty.buffer.Unpooled;
import org.artifact.core.context.bytebuf.IByteBuff;
import org.artifact.core.context.bytebuf.IByteBuffFactory;

/**
 * @author : SandKing
 * @CreateDate : 2019/8/6 10:54
 * @Description ：Please describe this document
 */
public class ProtocolBufFactory implements IByteBuffFactory {
    @Override
    public IByteBuff allocate() {
        return new ProtocolBuf(Unpooled.buffer());
    }

    @Override
    public IByteBuff wrap(byte[] data) {
        return new ProtocolBuf(Unpooled.wrappedBuffer(data));
    }
}
